<template>
  <div class="app-container inspectDes">
    <el-dialog
      title="详情"
      :visible.sync="centerDialogVisible"
      width="65%"
      :close-on-click-modal="false"
      :modal-append-to-body="false"
      :before-close="close"
      class="dialog"
      
      >
      <div style="max-width:1000px;margin:auto;">
    <p class="shenqing">标准信息</p>
    <table border="1" rules="all" class="tablestylec">
      <tr>
        <td style="width: 164px;height: 34px;text-align: center;">标准编号</td>
        <td  colspan="3" style="width: 1030px;padding-left: 10px">
          {{applicationData.standardCoder}}
        </td>
      </tr>
      <tr>
        <td style="width: 164px;height: 34px;text-align: center;">标准名称</td>
        <td  colspan="3" style="width: 1030px;padding-left: 10px">
          {{applicationData.standardName}}
        </td>
      </tr>
      <tr>
        <td style="width: 164px;height: 34px;text-align: center;">适用公司</td>
        <td  colspan="3" style="width: 1030px;padding-left: 10px">
          {{applicationData.deptName}}
        </td>
      </tr>
      <tr>
        <td style="width: 164px;height: 34px;text-align: center;">类型</td>
        <td style="width: 415px; padding-left: 10px;">
          <span v-show="applicationData.standardType=='1'">通用</span>
          <span v-show="applicationData.standardType=='2'">按设备</span>
          <span v-show="applicationData.standardType=='3'">按分类</span>
        </td>
        <td style="width: 164px;height: 34px;text-align: center;">设备分类</td>
        <td style="width: 415px; padding-left: 10px;">  {{applicationData.deviceType}}</td>
      </tr>
      <tr>
        <td style="width: 164px;height: 34px;text-align: center;">要求</td>
        <td  colspan="3" style="width: 1030px;padding-left: 10px">
          {{applicationData.require}}
        </td>
      </tr>
      <tr>
        <td style="width: 164px;height: 34px;text-align: center;">备注</td>
        <td  colspan="3" style="width: 1030px;padding-left: 10px">
          {{applicationData.remark}}
        </td>
      </tr>
    </table>
    <el-row >
      <p class="shenqing">关联设备</p>
      <el-table
        :data="applicationData.devicePollingStandardEquipmentsList"
        border
        stripe
        style="width: 1196px;margin-left: 15px">
        <el-table-column
          type="index"
          label="序号"
          align="center"
          width="50">
        </el-table-column>
        <el-table-column
          prop="deviceCode"
          label="设备编号"
          align="center"
          width="180">
        </el-table-column>
        <el-table-column
          prop="deviceName"
          label="名称"
          align="center"
          width="180">
        </el-table-column>
        <el-table-column
          align="center"
          prop="brandName"
          label="品牌">
        </el-table-column>

        <el-table-column
          align="center"
          prop="deviceType"
          label="类别">
        </el-table-column>
        <el-table-column
          align="center"
          prop="deviceModel"
          label="规格型号">
        </el-table-column>
      </el-table>
    </el-row>

    <el-row >
      <p class="shenqing">点检项目</p>
      <el-table
        :data="applicationData.deviceSpotCheckProjectVoList"
        border
        stripe
        style="width: 1196px;margin-left: 15px">
        <el-table-column
          type="index"
          label="序号"
          align="center"
          width="50">
        </el-table-column>
        <el-table-column
          prop="projectName"
          label="项目"
          align="center"
          width="180">
        </el-table-column>
        <el-table-column
          prop="spotCheckMethod"
          label="点检方法及基准"
          align="center"
          width="180">
        </el-table-column>
        <el-table-column
          align="center"
          prop="spotCheckType"
          label="类型">
          <template slot-scope="scope">
            <span v-show="scope.row.spotCheckType=='1'">数值</span>
            <span v-show="scope.row.spotCheckType=='2'">选项</span>
            <span v-show="scope.row.spotCheckType=='3'">文本</span>
          </template>
        </el-table-column>

        <el-table-column
          align="center"
          prop="lowerLimit"
          label="下限">
        </el-table-column>
        <el-table-column
          align="center"
          prop="upperLimit"
          label="上限">
        </el-table-column>
        <el-table-column
          align="center"
          prop="options"
          label="可选项">
        </el-table-column>
        <el-table-column
          align="center"
          prop="normalOptions"
          label="正常选项">
        </el-table-column>
        <el-table-column
          align="center"
          prop="annexList"
          label="文档及图片">
          <template slot-scope="scope">
           <span v-for="item in scope.row.annexList">{{item.fileName}}</span>
          </template>
        </el-table-column>
      </el-table>
    </el-row>
      </div>
    </el-dialog>
  </div>
</template>

<script>

  import request from '@/utils/request'
  export default {
    name: "Role",
    props:['pid'],
    data() {
      return {
        centerDialogVisible:true,
        applicationData:{
          deviceSpotCheckProjectVoList:[]
        },
      };
    },
    created() {
      this.getTaskList()

    },
    methods: {
      getTaskList() {
        request({
          url: '/device/devicePollingStandard/' + this.pid,
          method: 'get',
        }).then(response => {
          this.applicationData = response.data
        });
      },
      close(){
        this.$emit('subSetChane')
      },
    }
  };
</script>
<style lang="scss">
.inspectDes{
  .dialog .el-dialog__body{
      height: 75vh;
      overflow: scroll;
  }
  .shenqing{
    color: #05A380;
    font-weight: 700;
    margin-left: 15px;
  }
  .tablestylec {
    margin-left: 15px;
    width: 900px;
    border: 1px solid #cccccc;
    color: #606266;
    font-size: inherit;
  }
  .fujian span{
    margin-left: 15px;
    cursor: pointer;
  }
}
  
</style>
